<% include ./top %>
<% include ./left.ejs %>
<style>
    td {
        text-align: center;
    }
</style>
<table border="1" style="width:70%; border-collapse: collapse;margin: 0 auto;" cellpadding="1px" id="list">

</table>

<script>

    function list() {
        var list = "";
        $.ajax({
            type: "get",
            url: "/selects",  //ss路由地址
            data: "AjaxType=list&t=" + new Date(),
            success: function (result) {

                list = list + "<tr>";
                list = list + " <td>ID</td>";
                list = list + "<td>标题</td>";
                list = list + "<td>内容</td>";

                list = list + "</tr>";
                if (result != "-1") {

                    for (var i = 0; i < result.length; i++) {
                        list = list + "<tr>";
                        list = list + " <td>" + result[i].id + "</td>";
                        list = list + "<td>" + result[i].name + "</td>";
                        list = list + "<td>" + result[i].textes+ "</td>";


                        list = list + "</tr>";
                    }
                }
                else {

                }

                $("#list").html(list);
            }
        });
    }

    list();



</script>

